import { createRouter,createWebHistory,RouterOptions} from "vue-router";
import Home from '../views/home/Index.vue';




// 路由信息
const routes:any = [
    {
        path: '/',
        name: 'home',
        component: Home,
        redirect: '/system/user'
    },
    {
        path: '/system',
        name: '系统管理',
        component: Home,
        children: [
            {
                path: 'user',
                name: '用户管理',
                component: () => import(/* webpackChunkName: "about" */ '../views/home/system/User.vue')
            },
            {
                path: 'role',
                name: '角色管理',
                component: () => import(/* webpackChunkName: "about" */ '../views/home/system/Role.vue')
            }
        ]
    },
    {
        path: '/login',
        name: '登录',
        component: () => import(/* webpackChunkName: "about" */ '../views/login/Login.vue')
    }

]

// 导出路由
const router = createRouter(<RouterOptions>{
    history: createWebHistory(),
    routes
})

export default router